package com.recharge.controller;

import com.recharge.bean.Switch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by CAOQI on 2016/12/30.
 */
@Controller
public class SwitchController {

    @Autowired
    private Switch aSwitch;

    @RequestMapping("/getOrderSwitch/{value}")
    @ResponseBody
    public String getOrderSwitch(@PathVariable("value")Boolean value){
        aSwitch.setGetOrderSwitch(value);
        return "Ok";
    }

    @RequestMapping("/notifySwitch/{value}")
    @ResponseBody
    public String notifySwitch(@PathVariable("value")Boolean value){
        aSwitch.setNotifySwitch(value);
        return "Ok";
    }

    @RequestMapping("/queryOrderSwitch/{value}")
    @ResponseBody
    public String queryOrderSwitch(@PathVariable("value")Boolean value){
        aSwitch.setQuerySwitch(value);
        return "Ok";
    }
}
